// @ts-ignore
import result from '/@utils/Axios.ts'
import axios from "axios";

// 获取识别记录
export function getYoloRecognitionRecord(params:any){
    return result({
        url:'/api/yolo_model/yoloRecognition/',
        method:'get',
        params:params
    })
}

// 获取识别统计
export function getYoloStatistics(params:any){
    return result({
        url:'/api/yolo_model/yoloStatistics/',
        method:'get',
        params:params
    })
}

export function deleteYOLOhistory(id:number){
    return result({
        url:`/api/yolo_model/recognition/${id}/`,
        method:'delete',
    })
}

export function modelVersions(){
    return result({
        url:'/api/yolo_model/yoloModelVersion/',
        method:'get',
    })
}

export function changeModel(model_version){
    return result({
        url:'/api/yolo_model/yoloModelVersion/',
        method:'post',
        data: {model_version}
    })
}

// 获取模型信息
export function yoloModelInfo(){
    return result({
        url:'/api/yolo_model/yoloModelInfo/',
        method:'get',
    })
}

//视频识别接口
export function videoRecognition(){
    // return result({
    //     url:'/api/yolo_model/videoRecognition/',
    //     method:'get',
    // })
}

export function videoRecognitionList(params:any){
    return result({
        url:'/api/yolo_model/videoRecognitionList/',
        method:'get',
        params: params
    })
}

export function uploadFrame(data){
    return axios.post('/api/yolo_model/cameraRecognition/', data, {
        headers: {
            'Content-Type': 'multipart/form-data'
        }
    });
}

export function deleteVideoRecognition(id:number){
    return result({
        url:`/api/yolo_model/videoRecognition/${id}/`,
        method:'delete',
    })
}
